using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Reflection;
using Deepcode.Flux.Core.Extensions;
using Deepcode.Flux.Core.Systems.Security;

public partial class Public_Login_Default : Deepcode.Flux.Core.UI.NonCachePage
{
	protected void Page_Load(object sender, EventArgs e)
    {
		AddinTreeNode lfNode = AddinTree.Tree.GetTreeNode("/Flux/LookFeel");
		string ai_logo		= (string) lfNode.BuildChildItem("loginLogo", this);
		string ai_caption	= (string) lfNode.BuildChildItem("loginCaption", this);
		mainPanel.Title = ai_caption;
		_logo.ImageUrl = ai_logo;
    }

	protected void LoginClick(object sender, System.EventArgs args)
	{
		AdministrationUsers users = new AdministrationUsers();
		AdministrationUser user = users.GetUserByFormCredentials( this.loginEmail.Text, this.loginPassword.Text );

		if( user != null )
			System.Web.Security.FormsAuthentication.RedirectFromLoginPage( user.EMailAddress, remember.Checked );
		else
			LoginErrors.Visible = true;
	}

}
